package com.mbbb.yygh.common.exception;

import io.swagger.annotations.ApiModelProperty;

public class YyghException extends RuntimeException {

    @ApiModelProperty(value = "状态码")
    private Integer code;

    private String msg;

    public YyghException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public YyghException() {
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof YyghException)) return false;
        final YyghException other = (YyghException) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$code = this.getCode();
        final Object other$code = other.getCode();
        if (this$code == null ? other$code != null : !this$code.equals(other$code)) return false;
        final Object this$msg = this.getMsg();
        final Object other$msg = other.getMsg();
        if (this$msg == null ? other$msg != null : !this$msg.equals(other$msg)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof YyghException;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $code = this.getCode();
        result = result * PRIME + ($code == null ? 43 : $code.hashCode());
        final Object $msg = this.getMsg();
        result = result * PRIME + ($msg == null ? 43 : $msg.hashCode());
        return result;
    }

    public String toString() {
        return "YyghException(code=" + this.getCode() + ", msg=" + this.getMsg() + ")";
    }
}
